Listing 21.34. Declaring class-level variables for the logObject module.
Option Explicit
'
' local storage
Private strFileName As String
Private intFileHandle As Integer
Private strHeader As String
'
Next, you need to create the Property Let and Property Get statements for the logObject properties. The code in Listing 21.35 shows you how to do this. Add this code to your logObject class module.
Listing 21.35. Adding the Public properties of logObject.
Public Property Get FileName() As Variant
FileName = strFileName
End Property
Public Property Let FileName(ByVal vNewValue As Variant)
strFileName = vNewValue
End Property
Public Property Get LogHeader() As Variant
LogHeader = strHeader
End Property
Public Property Let LogHeader(ByVal vNewValue As Variant)
strHeader = vNewValue
End Property
Finally, add the code from Listing 21.36 to the Class_Initialize and Class_Terminate events of the module. This handles all the initial setup and final cleanup of the logObject class.
Listing 21.36. Coding the Class_Initialize and Class_Terminate events.